var OvertureCheapFlightsFLIN
var OvertureFeelingLuckyFLIN
var OvertureLastMinuteFLIN
var OverturePrivateJetHireFLIN
var OvertureTopOfferFLIN
var OvertureTravelInsuranceFlightsFLIN
var FlightCentreFlights
var AirSouthwest
var ThomsonFlights
var ExpediaWhiteLabelFlights
var EmiratesFlights
var MeridianaFlights
var SkyscannerFlights
var FlightCentreFlightsExtra
var BookingBuddyFlights
var CimberSterlingFlights
var TravelpackFlights
var IcelandExpress
var UKFlyFlights
var NetflightsFlights
var SeaBreezeFlights
var DirectFlights
var NoOfSearchers = 22;
var aSearchers = new Array(22);
aSearchers[0] = new Array('', 'overturecheapflightsflin', true, true, '', '', '');
aSearchers[1] = new Array('', 'overturefeelingluckyflin', true, true, '', '', '');
aSearchers[2] = new Array('', 'overturelastminuteflin', true, true, '', '', '');
aSearchers[3] = new Array('', 'overtureprivatejethireflin', true, true, '', '', '');
aSearchers[4] = new Array('', 'overturetopofferflin', true, true, '', '', '');
aSearchers[5] = new Array('', 'overturetravelinsuranceflightsflin', true, true, '', '', '');
aSearchers[6] = new Array('146', 'flightcentreflights', true, true, '', '', '');
aSearchers[7] = new Array('148', 'airsouthwest', true, true, '', '', '');
aSearchers[8] = new Array('158', 'thomsonflights', true, true, '', '', '');
aSearchers[9] = new Array('161', 'expediawhitelabelflights', true, true, '', '', '');
aSearchers[10] = new Array('182', 'emiratesflights', true, true, '', '', '');
aSearchers[11] = new Array('183', 'meridianaflights', true, true, '', '', '');
aSearchers[12] = new Array('185', 'skyscannerflights', true, true, '', '', '');
aSearchers[13] = new Array('193', 'flightcentreflightsextra', true, true, '', '', '');
aSearchers[14] = new Array('197', 'bookingbuddyflights', true, true, '', '', '');
aSearchers[15] = new Array('200', 'cimbersterlingflights', true, true, '', '', '');
aSearchers[16] = new Array('215', 'travelpackflights', true, true, '', '', '');
aSearchers[17] = new Array('226', 'icelandexpress', true, true, '', '', '');
aSearchers[18] = new Array('227', 'ukflyflights', true, true, '', '', '');
aSearchers[19] = new Array('228', 'netflightsflights', true, true, '', '', '');
aSearchers[20] = new Array('237', 'seabreezeflights', true, true, '', '', '');
aSearchers[21] = new Array('240', 'directflights', true, true, '', '', '');


var MonthNames = new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec')
var MonthLongNames = new Array('January','February','March','April','May','June','July','August','September','October','November','December')
var TwoDigitMonths = new Array('01','02','03','04','05','06','07','08','09','10','11','12')
var TwoDigitDays = new Array('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31')



function fFormSubmit(vFormName) {
    bigwin_new(vFormName);
    document.forms[vFormName].submit();
    
    return true;
}

function fGetDateFromDDMMYYY(vDateStr) {
    var lDay   = vDateStr.substring(0,vDateStr.indexOf('-'));
    var lMonth = vDateStr.substring(vDateStr.indexOf('-') + 1, vDateStr.indexOf('-', vDateStr.indexOf('-') + 1));
    var lYear  = vDateStr.substring(vDateStr.indexOf('-', vDateStr.indexOf('-') + 1) + 1);
    
	return new Date(lYear, lMonth - 1, lDay);
}

function fDateAdd(vStartDate, vDaysToAdd) {
    
    var objStartDate = new Date(vStartDate);
    var objEndDate = new Date(objStartDate.getTime() + vDaysToAdd*1000*86400);
    
    //return objEndDate.getDate() + '/' + (objEndDate.getMonth() + 1) + '/' + fGetYear(objEndDate) // + ' ' + objEndDate;
    return objEndDate;
}


function fDateDiff(startDate, endDate) {
    
    var objDate1 = new Date(endDate);
    var objDate2 = new Date(startDate);
    return (objDate1.getTime()-objDate2.getTime())/1000/86400;
}

function fGetYear(vDate) {
/*
	var ua = navigator.userAgent.toLowerCase();
	isIE = ((ua.indexOf("msie") != -1) && (ua.indexOf("opera") == -1) && (ua.indexOf("webtv") == -1)); 
	isGecko = (ua.indexOf("gecko") != -1);
	isSafari = (ua.indexOf("safari") != -1);
	isKonqueror = (ua.indexOf("konqueror") != -1);
*/	

    if (vDate.getYear() < 1900) {
        return vDate.getYear() + 1900;
    }
    else {
        return vDate.getYear();
    }
	
}

function fOptionText(rSelect) {
    return rSelect.options[rSelect.selectedIndex].text;
}


function fResetSelect(vSelName) {
    var lSelRef = getRefToObject(vSelName)
    var sDefaultDesc = getRefToObject(vSelName).options[0].innerHTML;
    lSelRef.disabled = true;
    lSelRef.options.length = 0;
    lSelRef.options[0] = new Option (sDefaultDesc, -1);
    lSelRef.style.display = 'none';
}

var IsValidSearch = false;

var ms_InfoRequired;
var firstresetlevel1 = true;
var firstresetlevel2 = true;
var firstresetlevel3 = true;
var firstresetlevel4 = true;

function fPutTitlesIn() {
    for (i=0;i<=NoOfSearchers-1;i++) {
        aSearchers[i][6] = getRefToObject('Logo' + aSearchers[i][1]).title;
    }    
}

function fGetSearchersDep(vSearcherName) {
    var lDep = -1;
    for (i=0;i<=NoOfSearchers-1;i++) {
        if (aSearchers[i][1] == vSearcherName) {
            lDep = aSearchers[i][4];
        }        
    }
    return lDep;
}

function fGetSearchersArr(vSearcherName) {
    var lArr = -1;
    for (i=0;i<=NoOfSearchers-1;i++) {
        if (aSearchers[i][1] == vSearcherName) {
            lArr = aSearchers[i][5];
        }        
    }
    return lArr;
}

function fResetLogos() {
    for(i=0;i<=NoOfSearchers-1;i++) {
        getRefToObject('Logo' + aSearchers[i][1]).style.display = 'block';
        getRefToObject('GO' + aSearchers[i][1]).src = '/images/go_button.gif';
        getRefToObject('Logo' + aSearchers[i][1]).title = aSearchers[i][6];
    }
}

// MKC20090320 store arrivals to attempt reset if departure changes
var aArrivals = new Array(5)
var lastparents = ''
var here = ''
var there = ''

function fDeparturesOnChange(rThis) {
	IsValidSearch = false;

    getRefToObject('CurrentLevel').value = 1;


    fResetSelect('DestinationL1');
    fResetSelect('DestinationL2');
    fResetSelect('DestinationL3');
    fResetSelect('DestinationL4');

    getRefToObject('WaitingForDestinationL1').style.display='block';

    if (lastparents != '' && !firstresetlevel1) //return to previously selected arrival point, if possible
        makeRequest('/Includes/Flights/l.asp?l=1&d=' + rThis.value + '&p=' + '&parents=' + lastparents, getRefToObject('DestinationL1'), 'o')    
    else if (firstresetlevel1) //only auto-select chosen destination first time through
        makeRequest('/Includes/Flights/l.asp?l=1&d=' + rThis.value + '&p=' + '&parents=81|89', getRefToObject('DestinationL1'), 'o')
    else
        makeRequest('/Includes/Flights/l.asp?l=1&d=' + rThis.value + '&p=', getRefToObject('DestinationL1'), 'o')
    if (rThis.value != -1) { 
        //makeRequest('/Includes/Flights/s.asp?d=' + rThis.value + '&a=', aSearchers, 'l');        
        var t=setTimeout( "makeRequest('/Includes/Flights/s.asp?ns=&d=" + rThis.value + "&a=', aSearchers, 'l')", 250); 
    }
    else {
       var t=setTimeout( "fResetLogos()", 250); 
       //fResetLogos();
    }
    firstresetlevel1 = false;
    
    //if (frames['flightcross']) {
    //    frames['flightcross'].location.href = '/Partners/Flight_Search/Flight_Search_cross.asp?parking=' + fOptionText(rThis);
    //}
}


function fArrivalsL1OnChange(rThis) {
	IsValidSearch = false;
    fResetSelect('DestinationL2');
    fResetSelect('DestinationL3');
    fResetSelect('DestinationL4');
    aArrivals[2] = ''
    aArrivals[3] = ''
    aArrivals[4] = ''    
    getRefToObject('CurrentLevel').value = 2;
    if (rThis.value != -1) {         
        ms_InfoRequired = document.forms['FlightMetaSearch']['DestinationL2'].options[0].innerHTML.replace(/-/g, '').replace(/ /g, '');
        getRefToObject('WaitingForDestinationL2').style.display='block';

        if (lastparents != '' && !firstresetlevel2) //return to previously selected arrival point, if possible
            var t=setTimeout( "makeRequest('/Includes/Flights/l.asp?l=2&d=" + getRefToObject('DepartFrom').value + "&p=" + rThis.value + "&parents=" + lastparents + "', getRefToObject('DestinationL2'), 'o')", 100);
        else if (firstresetlevel2) //only auto-select chosen destination first time through
            var t=setTimeout( "makeRequest('/Includes/Flights/l.asp?l=2&d=" + getRefToObject('DepartFrom').value + "&p=" + rThis.value + "&parents=81|89', getRefToObject('DestinationL2'), 'o')", 100);
        else
            var t=setTimeout( "makeRequest('/Includes/Flights/l.asp?l=2&d=" + getRefToObject('DepartFrom').value + "&p=" + rThis.value + "&parents=81|89', getRefToObject('DestinationL2'), 'o')", 100);

        if (!firstresetlevel2 || '' != '') { //MKC20090316 don't update clients after first auto-selection
            //MKC20071214 delay calls to determine logos to ensure destination is calculated first
            var t=setTimeout( "makeRequest('/Includes/Flights/s.asp?ns=&d=" + getRefToObject('DepartFrom').value + "&a=" + rThis.value + "', aSearchers, 'l')", 250); 
        }
        aArrivals[1] = rThis.value
        
        here = '|' + rThis.value + '|'
        there = '|' + lastparents + '|'
        if (there.indexOf(here) == -1) 
            lastparents = aArrivals[1]
            

        //updateZoo();            
            
    }
    else {
        var t=setTimeout( "makeRequest('/Includes/Flights/s.asp?ns=&d=" + getRefToObject('DepartFrom').value + "&a=', aSearchers, 'l')", 250); 
    }
    firstresetlevel2 = false;
}

function fArrivalsL2OnChange(rThis) {
	IsValidSearch = false;
    fResetSelect('DestinationL3');
    fResetSelect('DestinationL4');
    aArrivals[3] = ''
    aArrivals[4] = ''

    getRefToObject('CurrentLevel').value = 3;
    if (rThis.value != -1) { 
        ms_InfoRequired = document.forms['FlightMetaSearch']['DestinationL3'].options[0].innerHTML.replace(/-/g, '').replace(/ /g, '');
        getRefToObject('WaitingForDestinationL3').style.display='block';

        if (lastparents != '' && !firstresetlevel3) //return to previously selected arrival point, if possible
            var t=setTimeout( "makeRequest('/Includes/Flights/l.asp?l=3&d=" + getRefToObject('DepartFrom').value + "&p=" + rThis.value + "&parents=" + lastparents + "', getRefToObject('DestinationL3'), 'o')", 200);
        else if (firstresetlevel3) //only auto-select chosen destination first time through
            var t=setTimeout( "makeRequest('/Includes/Flights/l.asp?l=3&d=" + getRefToObject('DepartFrom').value + "&p=" + rThis.value + "&parents=81|89', getRefToObject('DestinationL3'), 'o')", 200);
        else
            var t=setTimeout( "makeRequest('/Includes/Flights/l.asp?l=3&d=" + getRefToObject('DepartFrom').value + "&p=" + rThis.value + "', getRefToObject('DestinationL3'), 'o')", 200);
        
        var t=setTimeout( "makeRequest('/Includes/Flights/s.asp?ns=&d=" + getRefToObject('DepartFrom').value + "&a=" + rThis.value + "', aSearchers, 'l')", 250); 

        aArrivals[2] = rThis.value

        here = '|' + rThis.value + '|'
        there = '|' + lastparents + '|'
        if (there.indexOf(here) == -1) 
            lastparents = aArrivals[1] + '|' + aArrivals[2]
    }
    else {
        var t=setTimeout( "makeRequest('/Includes/Flights/s.asp?ns=&d=" + getRefToObject('DepartFrom').value + "&a=" + getRefToObject('DestinationL1').value + "', aSearchers, 'l')", 250); 
        //makeRequest('/Includes/Flights/s.asp?d=' + getRefToObject('DepartFrom').value + '&a=' + getRefToObject('DestinationL1').value, aSearchers, 'l'); 
    }
    
    //MKC20090115 Get overture link for level2 location
    getOVurlFlights('cheap flights to ' + rThis.options[rThis.selectedIndex].text, 'flights', 3, 1644)
    
    firstresetlevel3 = false;
    
    try{
            
        if (document.getElementById("UKNEEasy"))
        {            
            document.getElementById("UKNEEasy").style.display = "none";
        }
        


        var tmp;
        
        tmp = 'Flights ' + rThis.options[rThis.selectedIndex].text;
        
        //from ' + document.getElementById('DepartFrom').options[document.getElementById('DepartFrom').selectedIndex].text + ' to
        //tmp = tmp.replace('All London (LON)','London');
                
        var a = makeStraightRequest(tmp);   
        
    }
    catch(e){}
}

function fArrivalsL3OnChange(rThis) {
	IsValidSearch = false;
    fResetSelect('DestinationL4');
    aArrivals[4] = ''    
    getRefToObject('CurrentLevel').value = 4;
    if (rThis.value != -1) { 
        ms_InfoRequired = document.forms['FlightMetaSearch']['DestinationL4'].options[0].innerHTML.replace(/-/g, '').replace(/ /g, '');
        getRefToObject('WaitingForDestinationL4').style.display='block';

        if (lastparents != '' && !firstresetlevel4) //return to previously selected arrival point, if possible
            var t=setTimeout( "makeRequest('/Includes/Flights/l.asp?l=4&d=" + getRefToObject('DepartFrom').value + "&p=" + rThis.value + "&parents=" + lastparents + "', getRefToObject('DestinationL4'), 'o')", 300); 
        else if (firstresetlevel4) //only auto-select chosen destination first time through
            var t=setTimeout( "makeRequest('/Includes/Flights/l.asp?l=4&d=" + getRefToObject('DepartFrom').value + "&p=" + rThis.value + "&parents=81|89', getRefToObject('DestinationL4'), 'o')", 300); 
        else
            var t=setTimeout( "makeRequest('/Includes/Flights/l.asp?l=4&d=" + getRefToObject('DepartFrom').value + "&p=" + rThis.value + "', getRefToObject('DestinationL4'), 'o')", 300); 

        var t=setTimeout( "makeRequest('/Includes/Flights/s.asp?ns=&d=" + getRefToObject('DepartFrom').value + "&a=" + rThis.value + "', aSearchers, 'l')", 250); 

        aArrivals[3] = rThis.value

        here = '|' + rThis.value + '|'
        there = '|' + lastparents + '|'
        if (there.indexOf(here) == -1) 
            lastparents = aArrivals[1] + '|' + aArrivals[2] + '|' + aArrivals[3]

    }
    else {
        var t=setTimeout( "makeRequest('/Includes/Flights/s.asp?ns=&d=" + getRefToObject('DepartFrom').value + "&a=" + getRefToObject('DestinationL2').value + "', aSearchers, 'l')", 250); 
        //makeRequest('/Includes/Flights/s.asp?d=' + getRefToObject('DepartFrom').value + '&a=' + getRefToObject('DestinationL2').value, aSearchers, 'l'); 
    }
    firstresetlevel4 = false;
    
    
}

function openFeelingLuckyWindow() {

    try{    
        var newUrl;
        var clickUrl;
        var newDirectURL;
    
        newDirectURL = document.getElementById("YURL").innerHTML;
        clickUrl = "http://clicks.flightsnetwork.co.uk/Click/MClick2.asp?PageUrl=/Travel/Flight_Seach/&COID=48&SI=NETL&CPC=0&URL=";

        newUrl = clickUrl + escape(newDirectURL);

        window.open(newUrl,'mywindow','toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes');
    }
    catch(e){}
}


function openOLNewWindow(ol, ooid, siteID, pageUrl) {

    try{    
        var newUrl;
        var clickUrl;
        var newDirectURL;
    
        newDirectURL = ol;
        clickUrl = "http://clicks.flightsnetwork.co.uk/Click/MClick2.asp?PageUrl=" + pageUrl + "&COID=" + ooid + "&SI=" + siteID + "&CPC=0&URL=";

        newUrl = clickUrl + escape(newDirectURL);

        window.open(newUrl,'mywindow','toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes');
    }
    catch(e){}
}



function fArrivalsL4OnChange(rThis) {
	IsValidSearch = false;
    if (rThis.value != -1) { 
        var t=setTimeout( "makeRequest('/Includes/Flights/s.asp?ns=&d=" + getRefToObject('DepartFrom').value + "&a=" + rThis.value + "', aSearchers, 'l')", 250); 
        aArrivals[4] = rThis.value
        lastparents = aArrivals[1] + '|' + aArrivals[2] + '|' + aArrivals[3] + '|' + aArrivals[4]
    }
    else {
        var t=setTimeout( "makeRequest('/Includes/Flights/s.asp?ns=&d=" + getRefToObject('DepartFrom').value + "&a=" + getRefToObject('DestinationL3').value + "', aSearchers, 'l')", 250); 
    }
       
}



function updateZoo() {

    var tempD,tempCountry
    
    tempCountry = document.getElementById("DestinationL1").options[document.getElementById("DestinationL1").selectedIndex].innerHTML;
    
    switch(tempCountry) {
        case (tempCountry = "Albania"):
         tempD = "TIA"; 
        break
        case (tempCountry = "Algeria"):
         tempD = "AZR+ALG+AAE+BLJ+CBH+BJA+BSK+CZL+DJG+ELU+GHA+HME+IAM+GJL+ORN+OGX+TMR+TEE+TID+TMX+TIN+TLM"; 
        break
        case (tempCountry = "Andorra"):
         tempD = "ALV"; 
        break
        case (tempCountry = "Anguilla"):
         tempD = "AXA"; 
        break
        case (tempCountry = "Antigua"):
         tempD = "ANU"; 
        break
        case (tempCountry = "Argentina"):
         tempD = "ARR+BHI+BUE+EZE+AEP+CRD+CTC+COC+COR+CNQ+EHL+EMX+EQS+FMA+GGS+OYA+IGR+JSM+JUJ+IRJ+ING+LGS+MDQ+MDZ+NQN+PRA+AOL+PMQ+PSS+PRQ+PUD+PMY+RCQ+RES+RCU+RGL+RGA+ROY+ROS+OES+BRC+UAQ+ULA+LUQ+CPC+AFA+RSA+REL+TUC+USH+VDM+VLG+VME"; 
        break
        case (tempCountry = "Armenia"):
         tempD = "LWN+EVN"; 
        break
        case (tempCountry = "Aruba"):
         tempD = "AUA"; 
        break
        case (tempCountry = "Australia"):
         tempD = "ADL+ABX+ASP+GYL+ARM+AUU+AYQ+BDD+BNK+ABM+BCI+BHS+BRT+BEU+BVI+BKQ+BLT+GIC+BOX+BQL+BRK+BMP+BWQ+BNE+BHQ+BME+BDB+BUC+BWT+CNS+CBR+CVQ+CSI+CED+CTL+CVC+CNJ+CAZ+CNC+CUQ+CFS+CPD+CTN+OOM+CNB+CKI+CMA+NLF+DRW+DDI+DNM+DRB+DPO+DMD+DBO+DKI+EDR+ELC+EMD+EPR+EXM+FIZ+GPN+GET+GLT+GLI+OOL+GBL+GOV+GFN+GFF+GTE+HCQ+HTI+HIS+HVB+HBA+HOK+HID+HGD+IVR+JCK+KAX+KTR+KWM+KUG+LST+LVO+LEA+LER+LNO+LHG+LDC+LSY+LZR+IRG+HAP+LRE+LDH+UBB+MKY+MNG+MBH+MCV+MKR+MEL+MIM+MQL+MGT+MJK+MOV+MRZ+ONG+MYA+MGB+MHU+ISA+WME+MMG+DGE+MYI+NAA+ZNE+RPM+NTN+NUB+NYN+OLP+OAG+PBO+PER+PUG+PHE+PLO+PQQ+PTJ+PPP+ULP+RAM+ROK+RMA+JHQ+SOI+SYU+MCY+SYD+TMW+TRO+TCA+THG+XTG+TIS+TPR+TWB+TSV+TGN+USL+VCD+WGA+WGE+WEI+WYA+WUN+WNR+WIN+WUD+WYN+XMY+OKR"; 
        break
        case (tempCountry = "Austria"):
         tempD = "GRZ+INN+LNZ+SZG+VIE"; 
        break
        case (tempCountry = "Bahamas"):
         tempD = "ASD+ATC+NSB+BIM+CRI+ELH+FPO+GGT+GHB+IGA+LGI+MAY+MHH+MYG+NAS+PID+RSD+ZSA+TZN+AXP+SML+TBI+TCB"; 
        break
        case (tempCountry = "Bahrain"):
         tempD = "BAH"; 
        break
        case (tempCountry = "Bangladesh"):
         tempD = "BZL+CGP+CXB+DAC+JSR+RJH+ZYL"; 
        break
        case (tempCountry = "Barbados"):
         tempD = "BGI"; 
        break
        case (tempCountry = "Belarus"):
         tempD = "MHP+MSQ+VTB"; 
        break
        case (tempCountry = "Belgium"):
         tempD = "ANR+ZAY+BRU+CRL+ZYR+LGG"; 
        break
        case (tempCountry = "Belize"):
         tempD = "BZE+TZA+CZH+DGA+PLJ+PND"; 
        break
        case (tempCountry = "Bermuda"):
         tempD = "BDA"; 
        break
        case (tempCountry = "Bolivia"):
         tempD = "BNX+CIJ+CBB+GYA+LPB+OMO+PSZ+RIB+VVI+SRE+TJA+TDD"; 
        break
        case (tempCountry = "Bosnia"):
         tempD = "SJJ"; 
        break
        case (tempCountry = "Botswana"):
         tempD = "FRW+GBE+BBK+MUB"; 
        break
        case (tempCountry = "Brazil"):
         tempD = "ATM+AJU+ARU+AUX+AAG+BRA+BAU+BEL+CNF+PLU+BVB+BSB+CPV+CPQ+CGR+CAW+CKS+CAC+CXJ+XAP+CMG+CCM+CZS+CGB+CWB+DOU+FEN+FLN+FOR+FRC+GYN+GVR+IGU+IOS+IMP+IPN+ITB+JCR+JPR+JPA+JOI+JDO+JDF+LAJ+LDB+MCP+MCZ+MAO+MAB+MII+MGF+MEU+MOC+MVS+NAT+NVT+PMW+PHB+PFB+PET+PNZ+PMG+POA+BPS+PVH+PPB+REC+RAO+RBR+GIG+RIG+RVD+SSA+RIA+STM+GEL+SAO+CGH+GRU+VCP+SLZ+SOD+TBT+TFF+THE+TOW+TMT+TUR+UBA+UDI+URG+VAG+BVH+VDC"; 
        break
        case (tempCountry = "British Virgin Islands"):
         tempD = "BVI+EIS+VIJ"; 
        break
        case (tempCountry = "Brunei"):
         tempD = "BWN"; 
        break
        case (tempCountry = "Bulgaria"):
         tempD = "BOJ+SOF+VAR"; 
        break
        case (tempCountry = "Cambodia"):
         tempD = "BBM+CYB+PNH+RBE+REP+TNX"; 
        break
        case (tempCountry = "Cameroon"):
         tempD = "DLA+MVR+NGE+YAO"; 
        break
        case (tempCountry = "Canada"):
         tempD = "YXX+AKV+XLY+XFS+YTF+YAA+YAX+YAB+YEK+YAT+YPJ+YBG+YBC+YBK+ZBF+XBE+ZEL+QBC+XVV+YBV+YTL+YBI+YBX+YVB+XPN+YBR+XFV+YBT+XBR+YPZ+YYC+YCB+YBL+XAZ+YTE+XAW+YRF+XZB+YCG+YAC+XCI+XDL+YLD+YHG+YYG+XCM+XHS+YCS+YHR+YMT+YKU+ZUM+YCY+XGJ+YCK+YQQ+YZS+YCC+XGK+YCA+YXC+YCR+YDN+YDI+YDA+YDQ+YDF+YWJ+XDM+YHD+DUQ+ZEM+YEG+YPF+YFO+ZFD+YFX+YFC+XFC+YFA+YPY+YAG+YGH+YFH+YMM+YYE+YER+YFS+YSM+YXJ+YQX+YGP+ZGS+YGX+YGB+YHK+XZC+YGO+ZGI+YYR+ZGF+YQU+XGY+YGZ+XIA+YHZ+YUX+YHM+YGV+YHY+XDU+YOJ+YHI+YHO+ZHO+YHB+YGT+YGR+ILF+XIB+YPH+YEV+YFB+YIV+YIK+XDH+XJL+XJQ+YKA+XGR+YWB+YKG+YYU+XKS+ZKE+KEW+ZKG+YLW+YQK+YLC+KIF+YGK+YKT+YBB+YCO+YVP+YGW+YGL+YVC+ZLT+YLQ+XLB+XEE+XEH+XEJ+YLH+YLR+YQL+YLL+YSG+YMH+XID+YXH+XEK+XEY+YQM+YYY+YMQ+YUL+YMX+YMY+XLM+YMO+MSA+YDP+YQN+YCD+ZNA+YSR+XIF+YNA+YNS+XEL+XEM+XLV+YVQ+YNO+YNE+YYB+YOG+YOC+YSB+YBS+YOO+YOW+YOH+YIF+YXP+XFE+XPB+YPC+YPE+YPO+YTA+YYF+XFG+YPL+YPM+XPX+YNL+YIO+YHP+YPB+YZT+YHA+YPN+YSO+YPX+YPW+YPA+YXS+YPR+XDW+XPK+YVM+XQU+YQC+YQB+YQZ+YRA+YOP+YRT+YRL+YRS+YQR+YUT+YRB+YRG+YXK+XRP+YRJ+ZRJ+YUY+ZPB+YSY+XKV+YZG+YZP+ZSJ+YSK+YZR+YXE+YAM+YKL+XFK+YZV+ZTM+YXL+YSH+YYD+YFJ+XSI+YAY+YCM+XIM+YSJ+YYT+YSL+XIO+YST+YJT+YSF+XTY+SUR+ZJN+YQY+XTL+YYH+YTQ+YXT+ZTB+YQD+YTD+YTH+YQT+YTS+YAZ+YTO+YYZ+XLQ+YBZ+YTZ+XLZ+YUB+ZFN+YUD+YBE+YVO+YVR+XEA+CXH+YYJ+YWK+YKQ+YKF+XWA+YWP+YNC+XFQ+YLE+YXN+YWR+YXY+YWL+YWM+YQG+XEC+YWG+XEF+ZWL+XIP+WNN+XWY+YQI+YZF+ZAC"; 
        break
        case (tempCountry = "Canary Islands"):
         tempD = "ACE+LPA+TFS+TFN+TCI+FUE+PLP"; 
        break
        case (tempCountry = "Cayman Islands"):
         tempD = "GCM"; 
        break
        case (tempCountry = "Chad"):
         tempD = "AMO+NDJ"; 
        break
        case (tempCountry = "Channel Islands"):
         tempD = "JER+GCI+ACI"; 
        break
        case (tempCountry = "Chile & Easter Island"):
         tempD = "ANF+ARI+BBA+CJC+YAI+CCP+CPO+ESR+IQQ+LSC+PMC+PUQ+SCL+ZCO+ZAL+IPC"; 
        break
        case (tempCountry = "China"):
         tempD = "AKU+AAT+AQG+AKA+BPX+BSD+BAV+BHY+PEK+CGQ+CGD+CZX+CHG+CTU+CIF+CKG+DLU+DLC+DAX+DYG+DNH+ENH+FUG+FOC+GOQ+CAN+KWL+KWE+HAK+HLD+HGH+HZG+HRB+HFE+HET+HKG+HTN+HYN+JMU+JGN+TNA+JDZ+JHG+JJN+JNZ+JUZ+ZGC+LXA+LYG+LJG+LYI+LZH+LYA+LUM+LZO+MFM+MXZ+MDG+NAO+NKG+NNG+NTG+NNY+NGB+IQM+TAO+NDG+SYX+PVG+SHA+SWA+SZX+SYM+TCG+TYN+TSN+TGO+TXN+HLH+URC+WXN+WEH+WNZ+WUH+WUS+XIY+XMN+XFN+XIC+XIL+XNN+XUZ+ENY+YNZ+YNJ+YNT+YBP+YIH+INC+YIN+YIW+UYN+ZHA+ZAT+CGO+HSN+ZUH"; 
        break
        case (tempCountry = "Colombia"):
         tempD = "APO+AUC+AXM+BSC+EJA+BAQ+BOG+BGA+CLO+CTG+CAQ+COG+CUC+EYP+FLA+IBE+IPI+LET+MZL+MDE+EOH+MTR+NVA+OTU+PSO+PEI+PBE+UIB+RCH+ADZ+SMR+TCO+VUP"; 
        break
        case (tempCountry = "Cook Islands"):
         tempD = "AIT+AIU+MGS+MHX+MUK+MOI+PYE+RAR"; 
        break
        case (tempCountry = "Costa Rica"):
         tempD = "ABJ+BCL+RIK+GGN+GLF+LIR+NOB+PMZ+PJM+PBP+XQP+SJO+TNO+TMU+TTQ"; 
        break
        case (tempCountry = "Cote d'Ivoire"):
         tempD = ""; 
        break
        case (tempCountry = "Croatia"):
         tempD = "BWK+DBV+OSI+PUY+RJK+SPU+ZAD+ZAG"; 
        break
        case (tempCountry = "Cuba"):
         tempD = "BCA+BYM+CMW+CCC+CYO+AVI+GAO+HAV+HOG+MZO+MOA+GER+VRA"; 
        break
        case (tempCountry = "Cyprus"):
         tempD = "ECN+LCA+NIC+PFO"; 
        break
        case (tempCountry = "Czech Republic"):
         tempD = "BRQ+ZDN+OSR+PRG"; 
        break
        case (tempCountry = "Democratic Republic of Congo"):
         tempD = "BOA+BZV+FIH+FBM+MDK+MJM+MNB+MAT+NIX+PNR"; 
        break
        case (tempCountry = "Denmark"):
         tempD = "AAL+AAR+ZID+BLL+RNN+BWE+CPH+EBJ+ZBJ+XAK+MJD+ZBQ"; 
        break
        case (tempCountry = "Dominica"):
         tempD = "DCF+DOM"; 
        break
        case (tempCountry = "Dominican Republic"):
         tempD = "LRM+EPS+POP+PUJ+STI+HEX+SDQ"; 
        break
        case (tempCountry = "Ecuador & the Galapagos Islands"):
         tempD = "CUE+ESM+GPS+GYE+LGQ+LOH+XMS+MCH+MEC+PVO+UIO+TUA+GPS+SCY"; 
        break
        case (tempCountry = "Egypt"):
         tempD = "ABS+AAC+ALY+ATZ+ASW+HBE+CAI+HRG+UVL+LXR+RMF+MUH+SSH+TCP"; 
        break
        case (tempCountry = "El Salvador"):
         tempD = "SAL"; 
        break
        case (tempCountry = "England"):
         tempD = "BQH+BHX+BLK+BOH+BRS+CBG+CAL+CEG+CVT+DSA+MME+EOI+EXT+FZO+GCI+HUY+IOM+JER+LEQ+LBA+LPL+LON+LCY+LGW+LHR+LTN+STN+LDY+MAN+MSE+NCL+NQY+NWI+EMA+PZE+PLH+SZD+SOU"; 
        break
        case (tempCountry = "Equatorial Guinea"):
         tempD = "SSG"; 
        break
        case (tempCountry = "Estonia"):
         tempD = "KDL+TLL"; 
        break
        case (tempCountry = "Ethiopia"):
         tempD = "ADD+AMH+ASO+BJR+BEI+DBM+DBT+DEM+DSE+DIR+GMB+GOB+GDE+GDQ+GOR+JIJ+JIM+BCO+ABK+LLI+MQX+MKS+NDM+MTF+EGL+HIL+TIE+TUJ"; 
        break
        case (tempCountry = "Falkland Islands"):
         tempD = "MPN+PSY"; 
        break
        case (tempCountry = "Faroe Islands"):
         tempD = "FAE"; 
        break
        case (tempCountry = "Federated States of Micronesia"):
         tempD = "PNI+TKK+ULI+YAP"; 
        break
        case (tempCountry = "Fiji"):
         tempD = "LEV+CST+ICI+LBS+LKB+LUC+PTF+MNF+MFJ+NAN+NGI+SVU+SUV+TVU+VBV"; 
        break
        case (tempCountry = "Finland"):
         tempD = "ENF+HEL+IVL+JOE+JYV+KAJ+KTT+KUO+KAO+LPP+MHQ+MIK+OUL+POR+RVN+SVL+TMP+TKU+VAA+VRK"; 
        break
        case (tempCountry = "France"):
         tempD = "AGF+AJA+ANE+QXG+ANG+NCY+AUR+AVN+BIA+EGC+BZR+BIQ+BOD+BES+BVE+CFR+CLY+CCF+DCM+CMF+CFE+DOL+DIJ+DNR+EPL+FSC+GNB+LAI+LRH+LEH+ZLN+LPY+LTQ+XDB+LIL+LIG+LRT+LDE+LYS+CEQ+MRS+ETZ+MPL+MLH+NTE+NCE+FNI+PAR+BVA+CDG+ORY+PUF+PGX+PGF+PIS+XOP+UIP+RNS+RNE+RDZ+URO+LTT+EBU+SXB+XER+TLN+TLS+TUF+XVS"; 
        break
        case (tempCountry = "French Polynesia"):
         tempD = "PPT"; 
        break
        case (tempCountry = "Gambia"):
         tempD = "BJL"; 
        break
        case (tempCountry = "Germany"):
         tempD = "AGB+BYU+BER+SXF+TXL+THF+BNJ+BMK+BRE+CGN+DTM+DRS+DUS+EIB+ERF+XFW+FLF+HHN+FRA+FDH+ZHQ+HAM+LBC+HAJ+HDB+HGL+HDF+HOQ+JUI+FKB+KLU+LEJ+MHG+MGL+FMO+MUC+NRD+NDZ+NUE+PAD+RLG+QFZ+STR+ZWS+AGE+GWT+WVN"; 
        break
        case (tempCountry = "Ghana"):
         tempD = "ACC"; 
        break
        case (tempCountry = "Greece"):
         tempD = "AXD+ATH+CHQ+CFU+HER+IOA+KLX+AOK+KVA+EFL+KGS+LXS+JMK+MJT+JNX+PAS+GPA+PVK+RHO+SMI+JSI+SKG+JTR+ZTH"; 
        break
        case (tempCountry = "Grenada"):
         tempD = "GND"; 
        break
        case (tempCountry = "Guadeloupe"):
         tempD = "PTP"; 
        break
        case (tempCountry = "Guatemala"):
         tempD = "FRS+GUA"; 
        break
        case (tempCountry = "Haiti"):
         tempD = "CAP+PAP"; 
        break
        case (tempCountry = "Honduras"):
         tempD = "BHG+GJA+LCE+PCH+PEU+RTB+SAP+TGU+TJI+UII"; 
        break
        case (tempCountry = "Hungary"):
         tempD = "SOB+BUD"; 
        break
        case (tempCountry = "Iceland"):
         tempD = "AEY+EGS+GRY+HFN+IFJ+KEF+REK+RPN+THO+VEY+VPN"; 
        break
        case (tempCountry = "India"):
         tempD = "IXA+AGR+AMD+AJL+ATQ+IXU+IXB+BLR+BHU+BHO+BBI+BHJ+BOM+CCU+IXC+COK+CJB+DIB+DMU+DIU+GAU+GOI+GWL+HYD+IMF+IDR+JAI+JGA+JDH+IXJ+JRH+HJR+CCJ+IXL+LKO+MAA+IXM+IXE+NAG+DEL+OKQ+PAT+PBD+IXZ+PNQ+PUT+RAJ+IXR+IXS+SXR+TEZ+TRV+TRZ+TIR+BDQ+VNS+VTZ"; 
        break
        case (tempCountry = "Indonesia"):
         tempD = "ARD+AMQ+AGD+AYW+BXB+BXD+BPN+BTJ+TKG+BDO+BDJ+BTH+BXM+BKS+BEJ+BIK+BMU+NTI+BUI+DRH+DTD+DPS+DIL+DOB+DUM+EWI+ENE+EWE+FKQ+GEB+GTO+ILA+IUL+INX+CGK+DJB+DJJ+KBX+KCD+KBF+KDI+LBJ+LUV+LKA+LPU+LBW+LUW+MDC+MKW+AMI+MOF+MES+MKQ+RDE+MDP+ONI+LII+NBX+NNX+OBD+OKL+PDG+PKY+PLM+PLW+PKN+PGK+PKU+PNK+PSU+ZRM+SXK+SRG+ZEG+ZRI+NKD+SQG+SOC+SUB+TMC+TMH+TJQ+TJS+TRK+TIM+TXM+TTE+UDR+UPG+WET+WBA+WGP+WMX+WSR+JOG+UGU"; 
        break
        case (tempCountry = "Iraq"):
         tempD = "BGW+SDA+XQC+BMN+XQV+BSR+XIH+KIK+OSM+XNH+EBL+XTM+XTV+OSO"; 
        break
        case (tempCountry = "Ireland"):
         tempD = "BFS+ORK+CFN+DUB+GWY+KIR+NOC+SNN+SXL+WAT"; 
        break
        case (tempCountry = "Israel"):
         tempD = "GZA+HFA+JRS+VDA+RRO+TLV"; 
        break
        case (tempCountry = "Italy"):
         tempD = "AHO+AOI+AOT+BRI+BLQ+BZO+BDS+CAG+CTA+CRV+ETH+EBA+PSA+FLR+FOG+GOA+SUF+LMP+MIL+LIN+MXP+BGY+NAP+OLB+PMO+PNL+PMF+PEG+PSR+REG+RMI+ROM+CIA+FCO+TAR+TTB+TPS+TRS+TRN+TSF+VCE+VRN"; 
        break
        case (tempCountry = "Jamaica"):
         tempD = "KIN+MBJ+NEG+OCJ+POT"; 
        break
        case (tempCountry = "Japan"):
         tempD = "AGJ+AXT+ASJ+AOJ+AKJ+FUJ+FUK+FKS+HAC+HKD+HTR+HIJ+HIW+ISG+IWJ+IZO+KTD+KCZ+UEO+KUH+MMJ+MYJ+MMB+MMD+MSJ+MYE+MMY+MBE+HNA+NGS+NGO+OBO+OIT+OKJ+OKA+OIR+OSA+ITM+KIX+OIM+RBJ+RIS+SPK+CTS+OKD+SYO+TRA+TKN+TKS+TYO+HND+NRT+TTJ+TOY+TSJ+UBJ+WKJ+GAJ+YGJ+OGN+RNJ"; 
        break
        case (tempCountry = "Kazakhstan"):
         tempD = "AKX+TSE+GUW+PWQ+CIT+URA+UKK"; 
        break
        case (tempCountry = "Kenya"):
         tempD = "ASV+EDL+KWY+LAU+MYD+MRE+MBA+NBO+WIL+NYK+UAS"; 
        break
        case (tempCountry = "Kuwait"):
         tempD = "KWI"; 
        break
        case (tempCountry = "Kyrgyzstan"):
         tempD = "FRU"; 
        break
        case (tempCountry = "Laos"):
         tempD = "HOE+LXG+LPQ+ODY+PKZ+ZVK+ZBY+VTE+XKH"; 
        break
        case (tempCountry = "Latvia"):
         tempD = "RIX"; 
        break
        case (tempCountry = "Lebanon"):
         tempD = "BEY"; 
        break
        case (tempCountry = "Liechtenstein"):
         tempD = ""; 
        break
        case (tempCountry = "Lithuania"):
         tempD = "KUN+PLQ+VNO"; 
        break
        case (tempCountry = "Luxembourg"):
         tempD = "LUX"; 
        break
        case (tempCountry = "Macedonia"):
         tempD = "OHD+SKP+WTA"; 
        break
        case (tempCountry = "Malaysia"):
         tempD = "AOR+BBN+BTU+BKZ+IPH+JHB+KBR+BKI+KUL+TGG+KUA+KCH+KUD+LBU+LDU+LGK+LWY+LMN+LBP+LGL+ODN+MKZ+MUR+MYY+MKM+MZV+PEN+TWU+TOD+TMG"; 
        break
        case (tempCountry = "Maldives"):
         tempD = "GAN+HAQ+KDM+KDO+MLE"; 
        break
        case (tempCountry = "Mali"):
         tempD = "BKO+GUD+MZI+TOM+EYL"; 
        break
        case (tempCountry = "Malta"):
         tempD = "GZM+MLA"; 
        break
        case (tempCountry = "Martinique"):
         tempD = "FDF"; 
        break
        case (tempCountry = "Mauritania"):
         tempD = "AEO+EMN+NDB+NKC+TIY+OUZ"; 
        break
        case (tempCountry = "Mauritius"):
         tempD = "MRU+RRG"; 
        break
        case (tempCountry = "Mexico"):
         tempD = "ACA+AGU+CPE+CUN+CTM+CUU+CME+CJS+CEN+CVM+CLQ+CZM+CVJ+CUL+DGO+GDL+GYM+GUB+HMO+HUX+ZIH+IZT+JAL+LAP+BJX+LTO+SJD+LMM+LZC+ZLO+MAM+MZT+MID+MXL+MEX+MTT+LOV+MTY+MLM+NLD+OAX+PQM+PDS+PAZ+PBC+PXM+PVR+QRO+REX+SZT+SLW+SLP+TAM+TAP+TPQ+TIJ+TLC+TRC+TGZ+UPN+VER+VSA+ZCL"; 
        break
        case (tempCountry = "Monaco"):
         tempD = "MCM"; 
        break
        case (tempCountry = "Montenegro"):
         tempD = "TIV+TGD"; 
        break
        case (tempCountry = "Morocco"):
         tempD = "AGA+AHU+CAS+CMN+VIL+FEZ+EUN+RAK+NDR+OZZ+OUD+RBA+TNG+TTU"; 
        break
        case (tempCountry = "Namibia"):
         tempD = "LUD+OKU+MPA+OND+OMD+SZM+TSB+WVB+WDH"; 
        break
        case (tempCountry = "Nepal"):
         tempD = "BDP+BWA+BHR+BIR+JKR+JMO+KTM+LUA+NGX+PKR"; 
        break
        case (tempCountry = "Netherlands"):
         tempD = "AMS+EIN+GRQ+MST+RTM"; 
        break
        case (tempCountry = "New Zealand"):
         tempD = "AKL+BHE+CHT+CHC+DUD+GIS+HLZ+HKK+IVC+KAT+MON+NPE+NSN+NPL+PMR+ZQN+ROT+TUO+TRG+TEU+TIU+WKA+WAG+WLG+WSZ+WHK+WRE"; 
        break
        case (tempCountry = "Nicaragua"):
         tempD = "MGA"; 
        break
        case (tempCountry = "Nigeria"):
         tempD = "ABV+CBQ+ENU+KAN+LOS+PHC"; 
        break
        case (tempCountry = "Norway"):
         tempD = "AES+ALF+ANX+BDU+BJF+BGO+BVG+BOO+BNN+VDB+FRO+FDE+HFT+EVE+HAA+HAU+HVG+LKL+LKN+MEH+MQN+MOL+MJF+OSY+NVK+HOV+OSL+TRF+RVK+ZXM+RRS+RET+QFK+SOG+SOJ+SVG+SVJ+TOS+TRD+VDS+VAW"; 
        break
        case (tempCountry = "Oman"):
         tempD = "MCT"; 
        break
        case (tempCountry = "Pakistan"):
         tempD = "BHV+BNP+CJL+DEA+DSK+LYP+GIL+GWD+ISB+JAG+JIW+KCF+KHI+KDD+LHE+MUX+MFG+WNS+ORW+PJG+PAJ+PSI+PEW+UET+RAZ+SUL+TUK+PZH"; 
        break
        case (tempCountry = "Panama"):
         tempD = "BFQ+BOC+CHX+CTD+ONX+OTD+DAV+ELE+GHE+JQE+CMU+PLP+PTY+NMG"; 
        break
        case (tempCountry = "Papua New Guinea"):
         tempD = "AUP+GUR+AZB+ARP+VMU+OPU+BOV+BUA+BXZ+CPI+CVL+DAU+DER+DDM+EMS+EMO+GAR+GRL+GOE+GKA+HIT+HKN+IHU+IDN+IOP+ITK+JAQ+KBM+KZF+KUY+KVG+UNG+KUQ+LAB+LAE+LNV+LSA+MAG+MFO+MAS+MDU+MYX+MIS+MXH+HGU+ATN+NDI+PNP+POM+RBP+RAB+SWG+TBG+TIZ+TKB+TDB+TFI+URU+VAI+VIV+AGL+WSU+WUG+WED+WWK+KYX"; 
        break
        case (tempCountry = "Paraguay"):
         tempD = "ASU+AGT"; 
        break
        case (tempCountry = "Peru"):
         tempD = "AQP+CJA+CIX+CUZ+IQT+JUL+LIM+PIU+PCL+PEM+TCQ+TPP+TRU+TBP"; 
        break
        case (tempCountry = "Philippines"):
         tempD = "BCD+BSO+BXU+CGY+CEB+CBO+DVO+DPL+DGT+GES+ILO+IPE+LAO+LGP+MNL+MBT+WNP+PPS+TAC+TUG+ZAM"; 
        break
        case (tempCountry = "Poland"):
         tempD = "BZG+GDN+KTW+QJY+OSZ+KRK+LCJ+POZ+SZZ+WAW+WRO+IEG"; 
        break
        case (tempCountry = "Portugal"):
         tempD = "CVU+FAO+FLW+FNC+GRW+HOR+LIS+PIX+PDL+OPO+PXO+SMA+TER"; 
        break
        case (tempCountry = "Puerto Rico"):
         tempD = "FAJ+VQS"; 
        break
        case (tempCountry = "Romania"):
         tempD = "ARW+BAY+BBU+OTP+CLJ+CND+IAS+OMR+SUJ+TSR+TGM"; 
        break
        case (tempCountry = "Russia"):
         tempD = "ABA+AER+AMV+DYR+AAQ+ARH+ASF+BAX+EGO+BQS+BTK+UUA+CSY+CEK+CEE+HTA+SVX+ESL+GDZ+IAA+INA+IKT+KGD+KZN+KXK+KYZ+GDX+MQF+MCX+MRV+MJZ+MOW+BKA+DME+SVO+VKO+MMK+NYM+NAL+NNM+NUX+NFG+NER+NJC+GOJ+NOJ+NSK+NVR+NOZ+OVB+OHO+OMS+REN+OSW+PEX+PEE+PKC+PES+PYJ+RAT+ROV+SLY+KUF+RTW+LED+STW+IKS+TOF+TJM+UFA+UCT+UUD+URJ+USK+UIK+OGZ+VVO+VLK+VOG+VKT+VOZ+YKS+IAR+UUS"; 
        break
        case (tempCountry = "Rwanda"):
         tempD = "KGL"; 
        break
        case (tempCountry = "Saint Kitts & Nevis"):
         tempD = "NEV+SKB"; 
        break
        case (tempCountry = "Saint Lucia"):
         tempD = "SLU+UVF"; 
        break
        case (tempCountry = "Saint Vincent & the Grenadines"):
         tempD = "CIW+SVD"; 
        break
        case (tempCountry = "Saudi Arabia"):
         tempD = "AHB+ABT+RAE+BHH+DMM+ELQ+GIZ+URY+HAS+HOF+JED+AJF+MED+EAM+AQI+RAH+RUH+TUU+TIF+TUI+WAE+EJH+YNB"; 
        break
        case (tempCountry = "Scotland"):
         tempD = "ABZ+EDI+GLA+PIK+WRY+BRR+BHD+BEB+DND+TRE+WIC+SOY+SYY+LWK+LSI+NDY+PPW+NRL+ILY+INV+FIE"; 
        break
        case (tempCountry = "Senegal"):
         tempD = "DKRa"; 
        break
        case (tempCountry = "Serbia"):
         tempD = "BEG+PRN"; 
        break
        case (tempCountry = "Seychelles"):
         tempD = "SEZ"; 
        break
        case (tempCountry = "Singapore"):
         tempD = "SIN+XSP"; 
        break
        case (tempCountry = "Slovakia"):
         tempD = "BTS+KSC+TAT"; 
        break
        case (tempCountry = "Slovenia"):
         tempD = "AFT+LJU+MBX"; 
        break
        case (tempCountry = "Somalia"):
         tempD = "BBO+BSA+BUO+HGA+MGQ"; 
        break
        case (tempCountry = "South Africa"):
         tempD = "ALJ+BFN+CPT+DUR+GRJ+HDS+JNB+MGH+NLP+PHW+PZB+PTG+PBZ+PLZ+RCB+SZK+NTY+ULD+UTT+UTN"; 
        break
        case (tempCountry = "South Korea"):
         tempD = "PUS+CJJ+TAE+KAG+KUV+KWJ+CJU+HIN+MPK+SEL+GMP+ICN+USN+WJU+RSU"; 
        break
        case (tempCountry = "Spain"):
         tempD = "ALC+LEI+OVD+BJZ+BCN+BIO+JCU+FUE+GIB+GRO+GRX+IBZ+XRY+LCG+ACE+LPA+MAD+AGP+MLN+MAH+MJV+PMI+PNA+REU+EAS+SPC+SDR+SCQ+SVQ+TCI+TFN+TFS+VLC+VLL+VDE+VGO+VIT+ZAZ"; 
        break
        case (tempCountry = "Sri Lanka"):
         tempD = "CMB"; 
        break
        case (tempCountry = "Sweden"):
         tempD = "JHE+AGH+AJR+BLE+GEV+GOT+GSE+HFS+HAD+HMV+HUV+HLF+JKG+LPI+LLA+LYC+MMX+MXX+NRK+ORB+OER+OSK+OSD+RNB+KVB+SOO+STO+ARN+BMA+SQO+EVG+TYF+THN+UME+VST+VXO+VHM+VBY"; 
        break
        case (tempCountry = "Switzerland"):
         tempD = "ACH+BSL+ZDH+BRN+ZDJ+GVA+LUG+ZRH"; 
        break
        case (tempCountry = "Syria"):
         tempD = "ALP+DAM+DEZ+KAC+LTK"; 
        break
        case (tempCountry = "Taiwan"):
         tempD = "CMJ+CYI+DYU+HUN+KHH+LBD+MZG+PIF+TXG+TNN+TPE+TSA+TTT+WOT"; 
        break
        case (tempCountry = "Tanzania"):
         tempD = "ARK+DAR+DOD+TKQ+JRO+LDI+MFA+MYW+MUZ+MWZ+PMA+TBO+ZNZ"; 
        break
        case (tempCountry = "Thailand"):
         tempD = "BKK+BFV+CNX+CEI+HDY+HHQ+USM+KBV+HGN+MAQ+NAK+NST+NNT+NAW+PHS+PRH+HKT+UNN+SNO+THS+URT+TST+UBP+UTH+UTP"; 
        break
        case (tempCountry = "The Palestinian Territories"):
         tempD = ""; 
        break
        case (tempCountry = "Tibet"):
         tempD = ""; 
        break
        case (tempCountry = "Trinidad & Tobago"):
         tempD = "POS+TAB"; 
        break
        case (tempCountry = "Tunisia"):
         tempD = "DJE+GAF+MIR+TBJ+TOE+TUN"; 
        break
        case (tempCountry = "Turkey"):
         tempD = "ADA+AJI+ANK+ESB+AYT+BZI+BAL+BJV+DLM+DNZ+DIY+EDO+EZS+ERC+ERZ+GZT+IST+ADB+KCM+ASR+KYA+MLX+MSR+VAS+TZX+VAN"; 
        break
        case (tempCountry = "Turks & Caicos"):
         tempD = "GDT+NCA+PLS+SLX+XSC"; 
        break
        case (tempCountry = "US Virgin Islands"):
         tempD = ""; 
        break
        case (tempCountry = "United States"):
         tempD = "BOS+CHI+SFB+MDW+ORD+DAL+DFW+DAY+DEN+FLL+HOU+IAH+LAS+LAX+MVY+MIA+NYC+JFK+LGA+EWR+MCO+ORL+SFB+PHL+SFO+SEA+SAN+TPA+WAS+IAD+DCA+BWI+ATL";
         //tempD = "ABR+ABI+ADK+BQN+KKI+AKI+CAK+KQA+AUK+ALM+ALS+ABY+ALB+CVO+QWY+ABQ+WKK+AEX+ESF+AET+ABE+AIA+APN+AOO+AMA+ABL+AKP+ANC+AGN+ANI+ANV+ATW+ACV+ARC+AVL+ASE+AHN+AKB+ATL+ACY+AIY+ATK+AGS+AUG+AUS+BFL+BWI+BGR+BHB+BRW+BTI+BTR+BPT+WBQ+ZBV+BKW+BED+BLV+BLI+BJI+BEH+BET+BTT+BIL+BGM+KBC+BHM+BIS+BID+BMI+BMG+BLF+BOI+BOS+BYA+BWG+BZN+BFD+BRD+BWD+QKB+BKX+RBH+BRO+BQK+BKC+BUF+IFP+BUR+BRL+BTV+BTM+CGI+LUR+EHM+MDH+CLD+CNM+CPR+CDC+CID+CEM+CDR+CIK+CMI+CHS+CRW+CLT+CHO+CHA+CYF+VAK+CYS+CHI+MDW+ORD+CKX+CIC+KCG+KCL+KCQ+CZN+CHU+CVG+IRC+CHP+CLP+CKB+CLE+CVN+COD+CFA+KCC+CDB+CLL+COS+COU+CAE+CSG+GTR+CMH+CCR+CNK+QCE+CDV+CRP+CEZ+CGA+CEC+CKO+CUW+CBE+DAL+DFW+DAY+DAB+DEC+DRG+DRT+DJN+DEN+QWM+DSM+DTW+DVL+DIK+DLG+DDC+DHN+DUJ+DBQ+DLH+DRO+DUT+EAU+EDA+EEK+KKU+KEK+IPL+ELD+ELP+ELV+ELI+EKO+ELM+LYU+EMK+WDG+ERI+ESC+EUG+EUE+EVV+FAI+FAR+FMN+FYV+XNA+FAY+FLG+FNT+FLO+FKL+FAT+FNL+FOD+FHU+FLL+TBN+RSW+FSM+VPS+FWA+GNV+GUP+GCK+GYY+GCC+GGW+GDV+GLV+GNU+GFK+GRI+GJT+GRR+GPZ+KGX+GBD+GTF+GRB+GSO+GLH+PGV+GMU+GVT+GSP+GPT+GCO+GUC+GST+HGR+HNS+HNM+PAK+CMX+HRL+MDT+HRO+BDL+HAE+HVR+HDN+HYS+HKB+HLN+HIB+HKY+ITO+HHH+HBB+HYL+HCR+HOM+HNL+MKK+HNH+HPB+HOT+HOU+IAH+HUS+HTS+HSV+HON+HSL+HYA+HYG+IDA+IGG+ILI+IND+INL+IYK+IMT+IWD+ISP+ITH+JAC+JAN+MKL+JAX+OAJ+JMS+JHW+JVL+JST+JBR+JLN+JNU+KAE+KNK+AZO+LUP+FCA+KLG+KAL+MUE+MCI+KXA+KUK+LIH+EAR+EEN+ENA+KTN+EYW+QKS+IAN+ILE+GRK+KVC+AKN+IGM+KPN+IRK+KVL+LMT+KLW+TYS+OBU+ADQ+KOA+KKH+KOT+OTZ+KYU+KWT+KWK+LSE+LAF+LFT+LCH+HII+LMA+LNY+LNS+LAN+LAR+LRD+LAS+LBE+PIB+LAW+LEB+KLL+LWB+LWS+LWT+LEX+LBL+LNK+LIT+LGB+LIJ+LOG+GGG+LPS+LAX+SDF+QWF+LBB+LYH+MCN+MSN+MDJ+MHT+MHK+MBL+MKT+MLY+KMO+MTH+MWA+MQT+MLL+MVY+MCW+MSS+OGG+JHM+MAZ+MFE+MCK+MCG+MFR+MYU+MLB+MEM+MCE+MEI+MTM+WMK+MIA+MAF+MLS+MKE+MSP+MOT+MNT+MSO+CNY+MOB+MOD+MLI+MLU+MRY+MGM+MTJ+MGW+MWH+WMH+MOU+MSL+MKG+MYR+ACK+WNA+PKA+APF+BNA+NKI+NLG+EWN+NCN+HVN+KGK+MSY+KNW+NYC+JFK+LGA+EWR+SWF+PHF+WWT+NME+NIB+IKO+WTK+OME+NNL+ORV+ORF+OTH+LBF+ORT+NUI+NUL+NUP+OAK+OGS+OKC+OMA+ONT+SNA+MCO+ORL+OSH+OTM+OWB+OXR+PAH+PGA+PSP+PFN+PKB+PSC+PDB+PEC+PLN+PDT+PNS+PIA+KPV+PSG+PTB+PHL+PHX+PIR+PQS+PIT+PTU+PLB+PIH+KPB+PHO+PIZ+PNC+PSE+PTA+CLM+KPC+PTH+PML+PPV+PCA+PWM+PDX+PSM+POU+PRC+PQI+PVD+PVC+SCC+PUB+PUW+UIN+KWN+RDU+RMP+RAP+RDG+RDV+RDD+RDM+RNO+RHI+RIC+RIW+ROA+RCE+RST+ROC+RKS+RFD+RKD+ROW+RBY+RSH+RUT+SMF+MBS+SLE+SLN+SBY+SLC+SJT+SAT+SAN+SFO+SJC+SJU+SBP+SDP+SFB+SBA+SAF+SMX+STS+SLK+SRQ+CIU+SAV+SVA+SCM+BFF+SEA+WLK+SWD+SHX+SKK+SXP+SHD+SHR+SHH+SHV+SHG+SVC+SUX+FSD+SIT+SGY+SLQ+SBN+WSN+SOP+GEG+SPI+SFY+SGH+SGF+STC+STX+SGU+STG+STL+KSM+SMK+SNP+PIE+STT+SCE+SBS+WBB+SVS+SCK+SRV+SUN+SYR+TCT+TKA+TLH+TPA+TAL+TSM+TEK+KTS+TEX+TKE+HUF+TEH+TXK+TVF+KTB+TNC+TOG+TKJ+OOK+TOL+FOE+TVC+TTN+TRI+TUS+TUL+TLT+WTL+TNK+TUP+TCL+TWF+TWA+TYR+UNK+UCA+UTO+EGE+QBF+VDZ+VLD+VEE+VEL+VCT+VIS+ACT+AIN+WAA+ALW+WAS+IAD+DCA+KWF+ALO+ART+ATY+CWA+EAT+PBI+WYS+WST+WSX+WWP+WMO+HPN+ICT+SPS+AVP+IPT+ISN+ILG+ILM+ILN+WRL+WRG+YKM+YAK+YNG+YUM"; 
        break
        case (tempCountry = "Uganda"):
         tempD = "RUA+EBB+ULU+JIN+PAF"; 
        break
        case (tempCountry = "Ukraine"):
         tempD = "DNK+DOK+IFO+HRK+IEV+KBP+KWG+VSG+LWO+MPW+ODS+PLV+UDJ+OZH"; 
        break
        case (tempCountry = "United Arab Emirates"):
         tempD = "AUH+AAN+FJR+DXB+RKT"; 
        break
        case (tempCountry = "Uruguay"):
         tempD = "MVD+PDP"; 
        break
        case (tempCountry = "Venezuela"):
         tempD = "AGV+BLA+BNS+BRM+CCS+CUP+CBL+CZE+CUM+VIG+GUI+LSP+MAR+MYC+MUN+MRD+PMV+PYH+PZO+SVZ+STB+STD+TUV+VLN+VLV"; 
        break
        case (tempCountry = "Vietnam"):
         tempD = "BMV+DAD+DLI+DIN+HPH+HAN+SGN+HUI+NHA+PQC+PXU+UIH+VKG+SQH+VII"; 
        break
        case (tempCountry = "Wales"):
         tempD = "CWL"; 
        break
        case (tempCountry = "Zambia"):
         tempD = "CIP+ZKB+KAA+LVI+LUN+MNR+MFU+NLA"; 
        break
        case (tempCountry = "Zimbabwe"):
         tempD = "BUQ+HRE+HWN+KAB+VFA"; 
        break
        default:
         tempD = "";
    }

    var setURL, depVal, depValpos, arrVal, arrValpos;

    depVal = "ABZ+ACI+BRR+BHD+BEB+BQH+BHX+BLK+BOH+BRS+CBG+CAL+CWL+CEG+CVT+DSA+DND+MME+EOI+EDI+EXT+FIE+FZO+PIK+GLA+GCI+HUY+INV+ILY+IOM+JER+LEQ+LBA+LPL+LON+LCY+LGW+LHR+LTN+STN+LDY+MAN+MSE+NCL+NQY+NRL+NWI+EMA+PPW+PZE+PLH+NDY+SZD+LWK+LSI+SOU+SYY+SOY+TRE+WRY+WIC"
        
    if ( tempD.length > 0 ) {
    
        setURL = "http://oascentral-uk.travelzoo.com/RealMedia/ads/adstream_sx.ads/www.flightsnetwork.co.uk/@Top?G=&O=" + depVal + "&D=" + tempD;
                    
        document.getElementById("Zoo").src=setURL;
    }                    
}




function TranslateInputs( FormName) {

    var Today = new Date();


    if( getRefToObject('WaitingForDestinationL1').style.display == 'block' || getRefToObject('WaitingForDestinationL2').style.display == 'block' || getRefToObject('WaitingForDestinationL3').style.display == 'block' || getRefToObject('WaitingForDestinationL4').style.display == 'block'){
        return false;
    }

    
    if (document.forms[FormName].directurl) {
        if (document.forms[FormName].directurl.value.indexOf('infospace.com') > 0) {
            document.forms[FormName].action = document.forms[FormName].action.replace('uknetguide', 'theanswerbank')
            document.forms[FormName].action = document.forms[FormName].action.replace('holidaysworld', 'theanswerbank')
            document.forms[FormName].action = document.forms[FormName].action.replace('flightsnetwork', 'theanswerbank')
            document.forms[FormName].PageURL.value = '/Search/'
        } 
    }

	
    var ms_DepartDate = document.forms['FlightMetaSearch']['DepartDate'].value;
    var ms_DepartDay   = ms_DepartDate.substring(0,ms_DepartDate.indexOf('-'));
    var ms_DepartMonth = ms_DepartDate.substring(ms_DepartDate.indexOf('-') + 1, ms_DepartDate.indexOf('-', ms_DepartDate.indexOf('-') + 1));
    var ms_DepartYear  = ms_DepartDate.substring(ms_DepartDate.indexOf('-', ms_DepartDate.indexOf('-') + 1) + 1);
    
	var DepartDate = new Date(ms_DepartYear, ms_DepartMonth - 1, ms_DepartDay);



    var ms_RetDate = document.forms['FlightMetaSearch']['ReturnDate'].value;
    var ms_RetDay   = ms_RetDate.substring(0,ms_RetDate.indexOf('-'));
    var ms_RetMonth = ms_RetDate.substring(ms_RetDate.indexOf('-') + 1, ms_RetDate.indexOf('-', ms_RetDate.indexOf('-') + 1));
    var ms_RetYear  = ms_RetDate.substring(ms_RetDate.indexOf('-', ms_RetDate.indexOf('-') + 1) + 1);
    
	var ReturnDate = new Date(ms_RetYear, ms_RetMonth - 1, ms_RetDay);
    var ms_OneWay = document.forms['FlightMetaSearch']['OneWayOnly'][0].checked;

    var DateDiffInDays = fDateDiff(DepartDate, ReturnDate)*1

    if(!cal_prs_date1(document.forms['FlightMetaSearch']['DepartDate'].value)) {
        return false;
    }
    
    if (!ms_OneWay) {
        if(!cal_prs_date1(document.forms['FlightMetaSearch']['ReturnDate'].value)) {
            return false;
        }
	    if (ReturnDate < DepartDate) {
	    	alert('Please select a return date on or after the departure date.');
	    	return false;
	    }
	}
	
/*	
    } else {
        ReturnDate  = fDateAdd(DepartDate, 7);;
        ms_RetDay   = ReturnDate.getDate();
        ms_RetMonth = ReturnDate.getMonth() + 1;
        ms_RetYear  = fGetYear(ReturnDate);
        ms_RetDate  = ms_RetDay + '-' + TwoDigitMonths[ms_RetMonth - 1] + '-' + ms_RetYear;
    }
*/	
	var ms_Adults   = document.forms['FlightMetaSearch']['Adults'].value;
	var ms_Children = document.forms['FlightMetaSearch']['Children'].value;
	var ms_Infants  = document.forms['FlightMetaSearch']['Infants'].value;

    if (document.forms['FlightMetaSearch']['DepartFrom'].selectedIndex == 0) {
        alert('Please select a departure location');
        return false;
    }

// MKC20080325 - all clickthroughs where nothing selected disabled. Finally! Yes!!
// MKC20061012 - temporarily allow clickthroughs everywhere
    if (document.forms['FlightMetaSearch']['DestinationL1'].selectedIndex == 0) {
        alert('Please select a destination');
        return false;
    }

	if (DepartDate < Today) {
		alert('Please select a departure date on or after today.');
		return false;
	}

	
    //var ms_DirectFlight = document.forms['FlightMetaSearch']['DirectFlightsOnly'].checked;
		
    var ms_DepName = fOptionText(document.forms['FlightMetaSearch']['DepartFrom']);
    var ms_DepIATA = ms_DepName.substring(ms_DepName.length - 4, ms_DepName.length - 1);
    ms_DepName = ms_DepName.substring(0, ms_DepName.length - 6);
    
    //MKC20071217 if we need this again then get it via the form. using the id is contrary to XHTML standards 
    //var ms_DestCity = getRefToObject('UKNEcity').value; //????
    
    var ms_DestName;
    var ms_DestFullName;
    
/*
    ms_DestName = getRefToObject('divDestinationFullName').innerHTML;
    if (ms_DestName == '&nbsp;') {ms_DestName = document.forms['FlightMetaSearch']['Destination'].value;}
*/

    var ms_Dest1Name = '';
    var ms_Dest2Name = '';
    var ms_Dest3Name = '';
    var ms_Dest4Name = '';

	ms_DestName = fOptionText(document.forms['FlightMetaSearch']['DestinationL1']);
	ms_DestFullName = ms_DestName;
	ms_Dest1Name = ms_DestName;
	if (document.forms['FlightMetaSearch']['DestinationL2'].value != -1) {
	    ms_DestName = fOptionText(document.forms['FlightMetaSearch']['DestinationL2']);
	    ms_Dest2Name = ms_DestName;
	    ms_DestFullName = ms_DestFullName  + ', ' + ms_DestName;
	    if (document.forms['FlightMetaSearch']['DestinationL3'].value != -1) {
	        ms_DestName = fOptionText(document.forms['FlightMetaSearch']['DestinationL3']);
	        ms_Dest3Name = ms_DestName;
	        ms_DestFullName = ms_DestFullName  + ', ' + ms_DestName;
	        if (document.forms['FlightMetaSearch']['DestinationL4'].value != -1) {
	            ms_DestName = fOptionText(document.forms['FlightMetaSearch']['DestinationL4']);
	            ms_Dest4Name = ms_DestName;
	            ms_DestFullName = ms_DestFullName  + ', ' + ms_DestName;
	        } else {
	            ms_InfoRequired = fOptionText(document.forms['FlightMetaSearch']['DestinationL4']);
	        }
	    } else {
	        ms_InfoRequired = fOptionText(document.forms['FlightMetaSearch']['DestinationL3']);
	    }
	    
	} else {
	    ms_InfoRequired = fOptionText(document.forms['FlightMetaSearch']['DestinationL2']);
	}
	
	ms_InfoRequired = ms_InfoRequired.replace(/-/g, '').replace(/ /g, '');

    
    	
	document.forms[FormName]['UKNEfrom'].value     = fOptionText(document.forms['FlightMetaSearch']['DepartFrom']);
	document.forms[FormName]['UKNEto'].value       = ms_DestName;
	document.forms[FormName]['UKNEdepdate'].value  = TwoDigitDays[ms_DepartDay - 1] + ' ' + MonthLongNames[ms_DepartMonth - 1] + ' ' + ms_DepartYear;

	//if (ms_OneWay) {
	//    document.forms[FormName]['UKNEretdate'].value = 'one way only';
	//} else {
	    document.forms[FormName]['UKNEretdate'].value  = TwoDigitDays[ms_RetDay - 1] + ' ' + MonthLongNames[ms_RetMonth - 1] + ' ' + ms_RetYear;
	//}

	document.forms[FormName]['UKNEadults'].value   = document.forms['FlightMetaSearch']['Adults'].value;
	document.forms[FormName]['UKNEchildren'].value = document.forms['FlightMetaSearch']['Children'].value;
	document.forms[FormName]['UKNEinfants'].value  = document.forms['FlightMetaSearch']['Infants'].value;
	
	//if (ms_DirectFlight) {
	//    document.forms[FormName]['UKNEDirectFlightsOnly'].value = 'Yes';
	//} else {
	    document.forms[FormName]['UKNEDirectFlightsOnly'].value = 'No';
	//}

	
	RecordTracking()	
	
    
	if (FormName == 'NetflightsFlights') {

        document.forms[FormName]['directurl'].value = fGetSearchersArr('netflightsflights');
        
        
        if (document.forms[FormName]['directurl'].value == -1) {
            alert('This partner offers flights to ' + ms_DestFullName + ' but requires ' + ms_InfoRequired + ' to be selected.');
            return false;
        }
        else {


            var url = 'http://www.netflights.com/flights/flight-results.aspx?cabin=Economy&itf=False&sof=True&nf=True&chf=True&pf=True&caf=True&Partner=uknetguide&RefID=NFTAF'
            url += '&from=' + fGetSearchersDep('netflightsflights');
            url += '&to=' + fGetSearchersArr('netflightsflights');
            url += '&depdate=' + TwoDigitDays[ms_DepartDay-1] + '/' + TwoDigitMonths[ms_DepartMonth-1] + '/' + ms_DepartYear;
            url += '&adults=' + ms_Adults;
            url += '&children=' + (1 * ms_Children + 1 * ms_Infants);
 		    if (ms_OneWay) {
                url += '&journeyType=False'; 
 		    } else {
                url += '&journeyType=False'; 
                url += '&arrdate=' + TwoDigitDays[ms_RetDay-1] + '/' + TwoDigitMonths[ms_RetMonth-1] + '/' + ms_RetYear;
            } 
 
            switch ('FLIN'){
                case 'FLIN':
                  url += '&partner=flightsnetwork'
                  document.forms[FormName]['directurl'].value = 'http://clk.atdmt.com/BRM/go/232802957/direct/01/=?href=' + escape(url)
                  break;
                case 'HOWO':
                  url += '&partner=holidaysworld'
                  document.forms[FormName]['directurl'].value = 'http://clk.atdmt.com/BRM/go/232802957/direct/01/=?href=' + escape(url)
                  break;
                default:
                  url += '&partner=uknetguide'
                  document.forms[FormName]['directurl'].value = 'http://clk.atdmt.com/BRM/go/232802957/direct/01/=?href=' + escape(url)
            }
        }

        fFormSubmit(FormName);
	}

	if (FormName == 'FlightCentreFlightsExtra') {

        document.forms[FormName]['directurl'].value = fGetSearchersArr('flightcentreflightsextra');
        
        if (document.forms[FormName]['directurl'].value == -1) {
            alert('This partner offers flights to ' + ms_DestFullName + ' but requires ' + ms_InfoRequired + ' to be selected.');
            return false;
        }
        else {


            document.forms[FormName]['directurl'].value = 'http://www.flightcentre.co.uk/deals/flights/' + document.forms[FormName]['directurl'].value            

        }

        fFormSubmit(FormName);
	}

	if (FormName == 'SkyscannerFlights') {

        document.forms[FormName]['oplace'].value = fGetSearchersDep('skyscannerflights');
        document.forms[FormName]['iplace'].value = fGetSearchersArr('skyscannerflights');
        
        
        if (document.forms[FormName]['iplace'].value == -1) {
            alert('This partner offers flights to ' + ms_DestFullName + ' but requires ' + ms_InfoRequired + ' to be selected.');
            return false;
        }
        else {


		    document.forms[FormName]['odate'].value = ms_DepartYear.substring(2,4) + TwoDigitMonths[ms_DepartMonth-1] + TwoDigitDays[ms_DepartDay - 1];
		    if (ms_OneWay) {
		        document.forms[FormName]['rtn'].value = 'no';
		    } else {
		        document.forms[FormName]['rtn'].value = 'yes';
		        document.forms[FormName]['idate'].value = ms_RetYear.substring(2,4) + TwoDigitMonths[ms_RetMonth-1] + TwoDigitDays[ms_RetDay - 1];		    
		    }
		    document.forms[FormName]['adult'].value = ms_Adults;
		    document.forms[FormName]['child'].value = ms_Children;
		    document.forms[FormName]['infant'].value = ms_Infants;
        }

        fFormSubmit(FormName);
	}

	if (FormName == 'RTravelFlights') {

        document.forms[FormName]['origin1'].value = fGetSearchersDep('rtravelflights');
        document.forms[FormName]['destinationid'].value = fGetSearchersArr('rtravelflights');

        
        if (document.forms[FormName]['destinationid'].value == -1) {
            alert('This partner offers flights to ' + ms_DestFullName + ' but requires ' + ms_InfoRequired + ' to be selected.');
            return false;
        }
        else {


		    document.forms[FormName]['fr'].value = TwoDigitDays[ms_DepartDay - 1] + '/' + TwoDigitMonths[ms_DepartMonth - 1] + '/' + ms_DepartYear;
		    if (!ms_OneWay) {
    		    document.forms[FormName]['ow'].value = '0';
    		    document.forms[FormName]['dur'].value = DateDiffInDays;            
            } else {
    		    document.forms[FormName]['ow'].value = '1';            
    		    document.forms[FormName]['dur'].value = '0';            
            }
		    document.forms[FormName]['adt1'].value = ms_Adults;
		    document.forms[FormName]['chd1'].value = ms_Children;
		    document.forms[FormName]['inf1'].value = ms_Infants;
		    
		
		}

        fFormSubmit(FormName);
	}

	if (FormName == 'TravelpackFlights') {

        document.forms[FormName]['From'].value = fGetSearchersDep('travelpackflights');
        document.forms[FormName]['To'].value = fGetSearchersArr('travelpackflights');
        
        
        if (document.forms[FormName]['To'].value == -1) {
            alert('This partner offers flights to ' + ms_DestFullName + ' but requires ' + ms_InfoRequired + ' to be selected.');
            return false;
        }
        else {


		    document.forms[FormName]['DepDate'].value = TwoDigitDays[ms_DepartDay - 1] + '/' + TwoDigitMonths[ms_DepartMonth-1] + '/' + ms_DepartYear;
		    if (ms_OneWay) {
		        document.forms[FormName]['Journey'].value = 'O';
		    } else {
		        document.forms[FormName]['Journey'].value = 'R';
		        document.forms[FormName]['RetDate'].value = TwoDigitDays[ms_RetDay - 1] + '/' + TwoDigitMonths[ms_RetMonth-1] + '/' + ms_RetYear;		    
		    }
		    document.forms[FormName]['Adults'].value = ms_Adults;
		    document.forms[FormName]['Children'].value = ms_Children;
		    document.forms[FormName]['Infants'].value = ms_Infants;
        }

        fFormSubmit(FormName);
	}

	if (FormName == 'HoodakiFlights') {


        //var destinations = fGetSearchersArr('hoodakiflights').split('||')

        document.forms[FormName]['d_code'].value = fGetSearchersDep('hoodakiflights');
        document.forms[FormName]['g_code'].value = fGetSearchersArr('hoodakiflights'); 

        
        if (document.forms[FormName]['g_code'].value == -1) {
            alert('This partner offers flights to ' + ms_DestFullName + ' but requires ' + ms_InfoRequired + ' to be selected.');
            return false;
        }
        else {


		    document.forms[FormName]['from'].value = TwoDigitDays[ms_DepartDay - 1] + '/' + TwoDigitMonths[ms_DepartMonth - 1] + '/' + ms_DepartYear;
		    if (ms_OneWay) {
		        document.forms[FormName]['faretype'].value = 'O';		    
		    } else {
		        document.forms[FormName]['faretype'].value = 'R';		    
		        document.forms[FormName]['to'].value = TwoDigitDays[ms_RetDay - 1] + '/' + TwoDigitMonths[ms_RetMonth - 1] + '/' + ms_RetYear;		    
		    }
		    document.forms[FormName]['adult'].value = ms_Adults;
		    document.forms[FormName]['child'].value = ms_Children;
		    document.forms[FormName]['infant'].value = ms_Infants;
		    //document.forms[FormName]['g_name'].value = destinations[1];
        }		

        fFormSubmit(FormName);
	}

	if (FormName == 'Travelshop365Flights') {

        document.forms[FormName]['origin1'].value = fGetSearchersDep('travelshop365flights');
        document.forms[FormName]['destinationid'].value = fGetSearchersArr('travelshop365flights');

        
        if (document.forms[FormName]['destinationid'].value == -1) {
            alert('This partner offers flights to ' + ms_DestFullName + ' but requires ' + ms_InfoRequired + ' to be selected.');
            return false;
        }
        else {


		    document.forms[FormName]['fr'].value = TwoDigitDays[ms_DepartDay - 1] + '/' + TwoDigitMonths[ms_DepartMonth - 1] + '/' + ms_DepartYear;
		    if (!ms_OneWay) {
    		    document.forms[FormName]['ow'].value = '0';
    		    document.forms[FormName]['dur'].value = DateDiffInDays;            
            } else {
    		    document.forms[FormName]['ow'].value = '1';            
    		    document.forms[FormName]['dur'].value = '0';            
            }
		    document.forms[FormName]['adt1'].value = ms_Adults;
		    document.forms[FormName]['chd1'].value = ms_Children;
		    document.forms[FormName]['inf1'].value = ms_Infants;
		    
		
		}

        fFormSubmit(FormName);
	}

	if (FormName == 'LiligoFlights') {

      
        document.forms[FormName]['fromLocation'].value = fGetSearchersDep('liligoflights');
        document.forms[FormName]['toLocation'].value = fGetSearchersArr('liligoflights');

        
        if (document.forms[FormName]['toLocation'].value == -1) {
            alert('This partner offers flights to ' + ms_DestFullName + ' but requires ' + ms_InfoRequired + ' to be selected.');
            return false;
        }
        else {



            document.forms[FormName]['depDay'].value = TwoDigitDays[ms_DepartDay - 1]
            document.forms[FormName]['depYear'].value = ms_DepartYear;
            
            if (!ms_OneWay) {
                document.forms[FormName]['retDay'].value = TwoDigitDays[ms_RetDay - 1]
                document.forms[FormName]['retMonth'].value = TwoDigitMonths[ms_RetMonth - 2];
                document.forms[FormName]['retYear'].value = ms_RetYear;
                document.forms[FormName]['roundTrip'].value = 'roundTrip';           
            } else {
                document.forms[FormName]['roundTrip'].value = 'oneWay';           
            }
            document.forms[FormName]['adults'].value = ms_Adults;
            document.forms[FormName]['children'].value = ms_Children;
            document.forms[FormName]['infants'].value = ms_Infants;
        }

        fFormSubmit(FormName);
	}

	if (FormName == 'CheapFlights') {


        document.forms[FormName]['from'].value = fGetSearchersDep('cheapflights');
        document.forms[FormName]['to'].value = fGetSearchersArr('cheapflights');

        
        if (document.forms[FormName]['to'].value == -1) {
            alert('This partner offers flights to ' + ms_DestFullName + ' but requires ' + ms_InfoRequired + ' to be selected.');
            return false;
        }
        else {


            switch ('FLIN'){
                case 'FLIN':
                  document.forms[FormName]['source'].value = 'link-FlightsNetwork'
                  break;
                case 'HOWO':
                  document.forms[FormName]['source'].value = 'link-HolidaysWorld'
                  break;
                default:
                  document.forms[FormName]['source'].value = 'link-uknetguide'
            }

        }

        fFormSubmit(FormName);
	}

	if (FormName == 'BookingBuddyFlights') {


        document.forms[FormName]['departure_city'].value = fGetSearchersDep('bookingbuddyflights');
        document.forms[FormName]['arrival_city'].value = fGetSearchersArr('bookingbuddyflights');

        
        if (document.forms[FormName]['arrival_city'].value == -1) {
            alert('This partner offers flights to ' + ms_DestFullName + ' but requires ' + ms_InfoRequired + ' to be selected.');
            return false;
        }
        else {



            document.forms[FormName]['departure_month'].value = TwoDigitMonths[ms_DepartMonth - 1] + ' ' + ms_DepartYear;
            document.forms[FormName]['departure_day'].value = TwoDigitDays[ms_DepartDay - 1];
		    if (ms_OneWay) {
                document.forms[FormName]['search_type'].value = 'oneway';
           } else {
                document.forms[FormName]['search_type'].value = 'roundtrip';
                document.forms[FormName]['return_month'].value = TwoDigitMonths[ms_RetMonth - 1] + ' ' + ms_RetYear;
                document.forms[FormName]['return_day'].value = TwoDigitDays[ms_RetDay - 1];          
            }
            document.forms[FormName]['num_travellers'].value = Number( ms_Adults) + Number( ms_Children) + Number( ms_Infants);
            if (document.forms[FormName]['num_travellers'].value > 6)
                document.forms[FormName]['num_travellers'].value = 6;
		     document.forms[FormName]['r'].value = 'bbs-uk_crystalguides_flightsnetwork_15131-a_001';  
        }

        fFormSubmit(FormName);
	}

	if (FormName == 'FlightCentreFlights') {

        document.forms[FormName]['directurl'].value = fGetSearchersArr('flightcentreflights');
        
        if (document.forms[FormName]['directurl'].value == -1) {
            alert('This partner offers flights to ' + ms_DestFullName + ' but requires ' + ms_InfoRequired + ' to be selected.');
            return false;
        }
        else {


            document.forms[FormName]['directurl'].value = 'http://www.flightcentre.co.uk/deals/flights/' + document.forms[FormName]['directurl'].value            

        }

        fFormSubmit(FormName);
	}

	if (FormName == 'ExpediaWhiteLabelFlights') {

        document.forms[FormName]['frairport'].value = fGetSearchersDep('expediawhitelabelflights');
        document.forms[FormName]['toairport'].value = fGetSearchersArr('expediawhitelabelflights');

        
        if (document.forms[FormName]['toairport'].value == -1) {
            alert('This partner offers flights to ' + ms_DestFullName + ' but requires ' + ms_InfoRequired + ' to be selected.');
            return false;
        }
        else {


		    document.forms[FormName]['fromdate'].value = TwoDigitDays[ms_DepartDay - 1] + '/' + TwoDigitMonths[ms_DepartMonth - 1] + '/' + ms_DepartYear;
		    if (!ms_OneWay) {
    		    document.forms[FormName]['TripType'].value = 'RoundTrip';
		        document.forms[FormName]['todate'].value = TwoDigitDays[ms_RetDay - 1] + '/' + TwoDigitMonths[ms_RetMonth - 1] + '/' + ms_RetYear;
            } else {
    		    document.forms[FormName]['TripType'].value = 'OneWay';            
            }
		    document.forms[FormName]['NumAdult'].value = ms_Adults;
		    document.forms[FormName]['NumInfant'].value = parseInt(ms_Children) + parseInt(ms_Infants);
		     document.forms[FormName]['rfrr'].value = '30004-841.01.181';  
		
		}

        fFormSubmit(FormName);
	}

	if (FormName == 'OvertureTopOfferFLIN') {

        fFormSubmit(FormName);
	}

	if (FormName == 'OvertureFeelingLucky') {

        fFormSubmit(FormName);
	}

	if (FormName == 'OverturePrivateJetHire') {

        fFormSubmit(FormName);
	}

	if (FormName == 'OvertureLastMinute') {

        fFormSubmit(FormName);
	}

	if (FormName == 'MeridianaFlights') {

        document.forms[FormName]['directurl'].value = fGetSearchersArr('meridianaflights');
        
        
        if (document.forms[FormName]['directurl'].value == -1) {
            alert('This partner offers flights to ' + ms_DestFullName + ' but requires ' + ms_InfoRequired + ' to be selected.');
            return false;
        }
        else {


            var url = '&setDepartureAirportCode=' + fGetSearchersDep('meridianaflights');
            url += '&APT1=' + fGetSearchersDep('meridianaflights');
            url += '&setArrivalAirportCode=' + fGetSearchersArr('meridianaflights');
            url += '&APT2=' + fGetSearchersArr('meridianaflights');
            url += '&setDepartureDate=' + ms_DepartDay + '/' + TwoDigitMonths[ms_DepartMonth-1] + '/' + ms_DepartYear;
		    if (!ms_OneWay) {
                url += '&setReturnDate=' + ms_RetDay + '/' + TwoDigitMonths[ms_RetMonth - 1] + '/' + ms_RetYear
                url += '&RET_MONTH=' + ms_RetMonth;
                url += '&RET_YEAR=' + ms_RetYear;
            }            
            url += '&DEP_MONTH=' + ms_DepartMonth;
            url += '&DEP_YEAR=' + ms_DepartYear;
 
            switch ('FLIN'){
                case 'FLIN':
                  document.forms[FormName]['directurl'].value = 'http://ad.zanox.com/ppc/?9223550C1156882016T&ULP=' + url  
                  break;
                default:
                  document.forms[FormName]['directurl'].value = 'http://ad.zanox.com/ppc/?9322064C1454615734T&ULP=' + url   
                  break;
            }
               
        }

        fFormSubmit(FormName);
	}

	if (FormName == 'EmiratesFlights') {

        document.forms[FormName]['directurl'].value = fGetSearchersArr('emiratesflights');
        
        
        if (document.forms[FormName]['directurl'].value == -1) {
            alert('This partner offers flights to ' + ms_DestFullName + ' but requires ' + ms_InfoRequired + ' to be selected.');
            return false;
        }
        else {


            var url = '&seldcity1=' + fGetSearchersDep('emiratesflights');
            url += '&selacity1=' + fGetSearchersArr('emiratesflights');
            url += '&selddate1=' + ms_DepartDay + '-' + MonthNames[ms_DepartMonth - 1] + '-' + ms_DepartYear;
            url += '&seladults=' + ms_Adults;
            url += '&selchildren=' + ms_Children;
            url += '&selinfants=' + ms_Infants;
		    if (ms_OneWay) {
                url += '&TID=OW'; 	    
		    } else {
                url += '&TID=RE';
                url += '&seladate1=' + ms_RetDay + '-' + MonthNames[ms_RetMonth - 1] + '-' + ms_RetYear 		    
		    }
 
            switch ('FLIN'){
                case 'FLIN':
                  document.forms[FormName]['directurl'].value = 'http://ad.zanox.com/ppc/?9204238C1818379440T&ULP=' + url  
                  break;
                default:
                  document.forms[FormName]['directurl'].value = 'http://ad.zanox.com/ppc/?9204224C1103350551T&ULP=' + url   
                  break;
            }
               
        }

        fFormSubmit(FormName);
	}

	if (FormName == 'FlybeFlights') {
           
        document.forms[FormName]['url'].value = fGetSearchersArr('flybeflights'); 

        
        if (document.forms[FormName]['url'].value == -1) {
            alert('This partner offers flights to ' + ms_DestFullName + ' but requires ' + ms_InfoRequired + ' to be selected.');
            return false;
        }
        else {


            var url = 'http://www.flybe.com/cam/flightSearchCriteria.do?page=0&requiredOutboundIndex=0&requiredReturnIndex=0&bookingSystemId=obs&fareType=CHEAPEST+AVAILABLE'
            url += '&selDep=' + fGetSearchersDep('flybeflights')
            url += '&selDest=' + fGetSearchersArr('flybeflights')
            url += '&numAdults=' + ms_Adults
            url += '&numChildren=' + ms_Children
            url += '&numInfants=' + ms_Infants
            url += '&selDepDay=' + TwoDigitDays[ms_DepartDay - 1];
            url += '&selDepMonth=' + ms_DepartYear + '' + TwoDigitMonths[ms_DepartMonth - 1];
		    if (ms_OneWay) {
                url += '&selRetDay=XX';
                url += '&selRetMonth=XXXXXX';		    
		    } else {
                url += '&selRetDay=' + TwoDigitDays[ms_RetDay - 1];
                url += '&selRetMonth=' + ms_RetYear + TwoDigitMonths[ms_RetMonth - 1];
		    }
		    document.forms[FormName]['url'].value = 'http://www.flybe.com/'
		}

        fFormSubmit(FormName);
	}

	if (FormName == 'AirSouthwest') {

        document.forms[FormName]['url'].value = fGetSearchersArr('airsouthwest'); 
        if (document.forms[FormName]['url'].value == -1) {
            alert('This partner offers flights to ' + ms_DestFullName + ' but requires ' + ms_InfoRequired + ' to be selected.');
            return false;
        }
        else {


            var URL = 'https://uk.airkiosk.com/cgi-bin/airkiosk/I7/81015lfa'
            
            URL += '?ORIGIN=' + fGetSearchersDep('airsouthwest')
            URL += '&DESTINATION=' + fGetSearchersArr('airsouthwest')
            URL += '&DAY=' + TwoDigitDays[ms_DepartDay - 1]
            URL += '&MONTHYEAR=' + MonthNames[ms_DepartMonth - 1].toUpperCase() + ms_DepartYear
		    if (!ms_OneWay) {
                URL += '&RDAY=' + TwoDigitDays[ms_RetDay - 1]
                URL += '&RMONTHYEAR=' + MonthNames[ms_RetMonth - 1].toUpperCase() + ms_RetYear
            } else {
                URL += '&RDAY=-1'
                URL += '&RMONTHYEAR=-1'
            }
            URL += '&ADULTS=' + ms_Adults
            URL += '&KIDS=' + ms_Children
            URL += '&INFANTS=' + ms_Infants
            URL += '&DIRECTION=SEARCH&AGENT=081027104601.78.86.112.175.17425'
            
            document.forms[FormName]['url'].value = URL
		}

        fFormSubmit(FormName);
	}

	if (FormName == 'flyBMIFlights') {

                
        document.forms[FormName]['directurl'].value = fGetSearchersArr('flybmiflights'); 

        
        if (document.forms[FormName]['directurl'].value == -1) {
            alert('This partner offers flights to ' + ms_DestFullName + ' but requires ' + ms_InfoRequired + ' to be selected.');
            return false;
        }
        else {

		    
		    var url;
		    url = encodeURIComponent('http://www.flybmi.com/bmi/en-gb/book-now/book-now.aspx?dep=' + fGetSearchersDep('flybmiflights') + '&arr=' + fGetSearchersArr('flybmiflights'));
		    
		     url = 'http://www.dpbolvw.net/click-2918122-10570309?url=' + url;  
		    
		    document.forms[FormName]['directurl'].value = url;
		    
		}

        fFormSubmit(FormName);
	}

	if (FormName == 'CimberSterlingFlights') {

        fFormSubmit(FormName);
	}

	if (FormName == 'GermanWingsFlights') {


        document.forms[FormName]['directurl'].value = fGetSearchersArr('germanwingsflights');

        
        if (document.forms[FormName]['directurl'].value == -1) {
            alert('This partner offers flights to ' + ms_DestFullName + ' but requires ' + ms_InfoRequired + ' to be selected.');
            return false;
        }
        else {


            var url = 'http://ad.zanox.com/ppc/?13003233C1069276297T&ULP=[[https://www.germanwings.com/skysales/Deeplink.aspx?lng=en-GB'
           
            url += '&o=' + fGetSearchersDep('germanwingsflights')
            url += '&d=' + fGetSearchersArr('germanwingsflights')
            url += '&od=' + ms_DepartYear + '-' + TwoDigitMonths[ms_DepartMonth - 1] + '-' + TwoDigitDays[ms_DepartDay - 1];
		    if (!ms_OneWay) {
                url += '&rd=' + ms_RetYear + '-' + TwoDigitMonths[ms_RetMonth - 1] + '-' + TwoDigitDays[ms_RetDay - 1];
                url += '&t=r' 
            } else {
                url += '&t=o' 
            }
            url += '&adt=' + ms_Adults;
            url += '&chd=' + ms_Children;
            url += '&inf=' + ms_Infants;
            url += ']]'
            
            document.forms[FormName]['directurl'].value = url
        }

        fFormSubmit(FormName);
	}

	if (FormName == 'IcelandExpress') {

        fFormSubmit(FormName);
	}

	if (FormName == 'OvertureTravelInsuranceFlights') {

        fFormSubmit(FormName);
	}

}



// GJW20041021 Added client-side validation for Flight search details
function ShowHelp() {

	if (document.forms['FlightMetaSearch']['DestinationL1'].value == '') {
		alert('Please enter your travel destination, then click on one of our partner links to conduct your search');
		document.forms['FlightMetaSearch']['DestinationL1'].focus;
		return false; 
	} else {
		alert('Please click on one of our partner links to conduct your search.');
		return false;
	}
}

fPutTitlesIn();
fDeparturesOnChange(document.forms['FlightMetaSearch'].DepartFrom)
